{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a58b5854",
   "metadata": {},
   "source": [
    "# 第二节：数据处理\n",
    "mindspore.dataset提供了部分常用数据集和标准格式数据集的加载接口,而mindvision.dataset提供了部分常用图像数据集加载接口。\n",
    "\n",
    "数据在喂给神经网络之前需要进行一系列操作，MindSpore中对数据的操作主要有加载、迭代、处理与增强，即将数据从数据库下载到本地、为了提高网络性能而迭代数据、将数据转换成能输入神经网络的数据类型、在只有少量数据时增加数据总量。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2caac713",
   "metadata": {},
   "source": [
    "## 一、加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a58a2d68",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:25:50.385.763 [mindspore\\dataset\\engine\\datasets_user_defined.py:656] Python multiprocessing is not supported on Windows platform.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:25:50.389.736 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Resize' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Resize' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:25:50.390.725 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Rescale' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Rescale' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:25:50.390.725 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Rescale' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Rescale' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:25:50.392.720 [mindspore\\dataset\\core\\validator_helpers.py:804] 'HWC2CHW' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'HWC2CHW' from mindspore.dataset.vision instead.\n"
     ]
    }
   ],
   "source": [
    "from mindvision.dataset import Mnist\n",
    "# 设置下载根目录\n",
    "dataset_dir = \"./Mnist\"\n",
    "# 设置数据集\n",
    "dataset = Mnist(path=dataset_dir, split=\"train\", batch_size=32, repeat_num=1, shuffle=True, resize=32, download=True)\n",
    "# 加载数据集\n",
    "dataset = dataset.run()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea228f64",
   "metadata": {},
   "source": [
    "### 加载数据集时各参数含义：\n",
    "path：指定根目录。\n",
    "\n",
    "split：指定该数据集是训练集、验证集还是测试集。\n",
    "\n",
    "batch_size：指定每一个batch的大小。\n",
    "\n",
    "repeat_num：指定数据重复次数。\n",
    "\n",
    "shuffle：指定是否打乱数据。\n",
    "\n",
    "resize：重新指定图像大小。\n",
    "\n",
    "download：指定是否下载数据集。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "db7a8559",
   "metadata": {},
   "source": [
    "## 二、迭代数据"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0198cc68",
   "metadata": {},
   "source": [
    "我们可以使用create_dict_iterator接口来创建数据迭代器，迭代访问数据。用Python内置next()方法可以返回迭代器的下一个项目。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "21dd1275",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Data type:<class 'mindspore.common.tensor.Tensor'>\n",
      "Image shape: (32, 1, 32, 32)\n",
      "Label: [1 2 8 2 9 5 0 3 9 9 3 9 8 0 3 5 5 8 7 2 1 1 1 6 3 7 4 0 7 3 1 5]\n"
     ]
    }
   ],
   "source": [
    "#获取一项数据\n",
    "data = next(dataset.create_dict_iterator())\n",
    "print(f\"Data type:{type(data['image'])}\\nImage shape: {data['image'].shape}\\nLabel: {data['label']}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d9400169",
   "metadata": {},
   "source": [
    "打印出的shape有四个values，分别是batch_size, 通道数(3代表彩色，1代表灰度图)， 最后两个表示图片的大小。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "09deca7b",
   "metadata": {},
   "source": [
    "### 可以使用matplotlib打印出数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "ece73252",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGKCAYAAACsHiO8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA7OElEQVR4nO3de3TU5Z348U+imXBJMuGWhNREUFBUBN3IZcBrTaW41YLo4m5bbW3LQYOVeva4Ym+/uj2bbbtnvR2qW7uCnpbFokW81GtQFBvQpKJcbEREiUJGUDMJAZKYPL8/PKQ+F8xMmDwz38n7dc7zx+fhk5lvhs+Eh+988jxZSiklAAAAnmSn+gIAAMDAwuIDAAB4xeIDAAB4xeIDAAB4xeIDAAB4xeIDAAB4xeIDAAB4xeIDAAB4xeIDAAB4xeIDAAB41W+Lj6VLl8qYMWNk0KBBMm3aNHnllVf666mApKJ2EVTULoIiqz/OdnnwwQflqquuknvuuUemTZsmt99+u6xatUoaGhqkqKjoC7+2u7tbdu/eLfn5+ZKVlZXsS8MAoZSS1tZWKS0tlezs+NfY1C5SjdpFUCVUu6ofTJ06VVVVVfXEXV1dqrS0VFVXV/f6tY2NjUpEGIykjMbGRmqXEchB7TKCOuKp3aR/7NLR0SH19fVSWVnZM5ednS2VlZVSW1tr5be3t0tLS0vPUByyiyTKz8+PO5faRTqhdhFU8dRu0hcf+/btk66uLikuLtbmi4uLpampycqvrq6WcDjcM8rLy5N9SRjAErmFTO0inVC7CKp4ajflv+2yZMkSicViPaOxsTHVlwTEhdpFUFG7SLVjk/2AI0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rUqaqqqqon7urqUqWlpaq6ujqFV5V5PvzwQyUiat26dUoppZqbm1VOTo5atWpVT86bb76pRETV1tam6jIDhdr1g9pNPmrXD2r3M2n3sUtHR4fU19dLZWVlz1x2drZUVlZKbW1tCq8s88RiMRERGT58uIiI1NfXS2dnp/baT5gwQcrLy3nt40Dt+kPtJhe16w+1+5m0W3zs27dPurq6pLi4WJsvLi6WpqamFF1V5unu7pbFixfLzJkzZeLEiSIi0tTUJKFQSAoLC7VcXvv4ULt+ULvJR+36Qe3+Xdqdags/qqqqZMuWLbJ+/fpUXwqQEGoXQUXt/l3a3fkYOXKkHHPMMVanbzQalZKSkhRdVWZZtGiRPP744/L888/3HKMtIlJSUiIdHR3S3Nys5fPax4fa7X/Ubv+gdvsftatLu8VHKBSSiooKqamp6Znr7u6WmpoaiUQiKbyy4FNKyaJFi2T16tWydu1aGTt2rPbnFRUVkpOTo732DQ0NsmvXLl77OFC7/Yfa7V/Ubv+hdo8gxQ2vTitXrlS5ublq+fLlatu2bWrBggWqsLBQNTU1pfrSAu3aa69V4XBYvfDCC2rPnj0948CBAz05CxcuVOXl5Wrt2rWqrq5ORSIRFYlEUnjVwULt9g9qt/9Ru/2D2nVLy8WHUkrdddddqry8XIVCITV16lS1YcOGVF9S4ImIcyxbtqwn5+DBg+q6665Tw4YNU0OGDFFz585Ve/bsSd1FBxC1m3zUrh/UbvJRu25ZSinl+24LAAAYuNKu5wMAAGQ2Fh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMArFh8AAMCr/w/X2/Oivy97rQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 640x480 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "# 将数据转成numpy类型\n",
    "images = data[\"image\"].asnumpy()\n",
    "labels = data[\"label\"].asnumpy()\n",
    "plt.figure()\n",
    "for i in range(1, 7):\n",
    "    plt.subplot(2, 3, i)\n",
    "    plt.imshow(images[i-1][0], interpolation=\"None\", cmap=\"gray\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c1d882a",
   "metadata": {},
   "source": [
    "## 三、处理数据\n",
    "mindspore或mindvision中的数据集都提供了数据处理接口，将数据处理成能输入神经网络的格式，处理方法与加载数据集时相同，但把download参数设置为False,默认为False。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7ea94b66",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:50:43.419.778 [mindspore\\dataset\\engine\\datasets_user_defined.py:656] Python multiprocessing is not supported on Windows platform.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:50:43.419.778 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Resize' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Resize' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:50:43.420.763 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Rescale' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Rescale' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:50:43.421.760 [mindspore\\dataset\\core\\validator_helpers.py:804] 'Rescale' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'Rescale' from mindspore.dataset.vision instead.\n",
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-10:50:43.421.760 [mindspore\\dataset\\core\\validator_helpers.py:804] 'HWC2CHW' from mindspore.dataset.vision.c_transforms is deprecated from version 1.8 and will be removed in a future version. Use 'HWC2CHW' from mindspore.dataset.vision instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Image shape:  (6, 1, 28, 28)\n"
     ]
    }
   ],
   "source": [
    "dataset = Mnist(path=dataset_dir, split=\"train\", batch_size=6, repeat_num=1, shuffle=True, resize=28)\n",
    "dataset = dataset.run()\n",
    "dataset = next(dataset.create_dict_iterator())\n",
    "\n",
    "images = dataset[\"image\"].asnumpy()\n",
    "print('Image shape: ', images.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f52edfde",
   "metadata": {},
   "source": [
    "## 四、增强数据\n",
    "当数据集很小的时候，训练出的神经网络性能很差，我们可以通过增强数据来扩大数据集的容量，从而提升模型的泛化能力。可行的操作有对图像进行自动裁剪、随机水平翻转、维度对调等。mindspore.dataset.versionAPI中提供了图像数据增强的接口，其他数据可查看官网API文档。使用时在数据处理参数中添加transform即可。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "6820bb6c",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[WARNING] ME(50208:43176,MainProcess):2022-09-28-11:24:52.115.164 [mindspore\\dataset\\engine\\datasets_user_defined.py:656] Python multiprocessing is not supported on Windows platform.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGKCAYAAACsHiO8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAzyElEQVR4nO3dfXRU1bn48SfBzACSTHhNjCTKVQStRbyRwAD1okbxpSoQr3ptK9VeKRi84kuVaFGL1mirC5SF2KUCrYrx0hqs4GuDQqkBSSxXAxi1osTCjOJvZRKQJJjs3x8upp6zj85MMrNnzuT7WWv/8ezsOWc7PoGHM3v2zlBKKQEAADAkM9kTAAAAvQvFBwAAMIriAwAAGEXxAQAAjKL4AAAARlF8AAAAoyg+AACAURQfAADAKIoPAABgFMUHAAAwKmHFx9KlS+XYY4+Vvn37yvjx4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u/w4svDZs2apY257bbbIl4HqWn//v1a36effmqJR48enbD7b9q0KWHX7m2S/lVbAADQu1B8AAAAoyg+AACAUaz5SLKsrCytb8aMGZZ4+fLl2hinz83tn2V//vnnEe8/dOhQrc/+ObnTgWK33367JXZaDPfrX/9a62tvb484JyRfTk6O0fv93//9nyX+4Q9/qI2xrzM66aSTtDGvvfaaJXZaGwX3cjqD5o477rDEf/jDH7Qx8frWz/PPP6/1TZ8+3RL/v//3/+Jyr3THkw8AAGAUxQcAADCK4gMAABhF8QEAAIzKUN+1bV4StLS0iM/nS/Y0jLFv6CUilgOiREReeeUVbcz555+v9SXqf+XRRx+t9b399tuW2Gnh6gknnKD1ffN8ChNCoZCxxZPplLtOm4ytWbMm4uvspySfffbZ2hh7fsNZb8vd3/72t5bYaaH7nj17tL7CwkJLfM4550Qcc+jQIW3MihUropqnnX2Bq/1kZZHE/dmcqqLJXZ58AAAAoyg+AACAURQfAADAKDYZM6y0tNQSP/7449oY++eD9oOTnMYk0j//+U+t795777XEDz74oDbG6YAn02s+0D32zbpERLZv326Jv/e970W8zrRp07Q+1nzAidN6DjunzcKGDBliiV999dWI18nM1P/dbV+fdMUVV0S8jojIlVdeaYnXrVunjfnjH/8Y1bV6E558AAAAoyg+AACAURQfAADAKIoPAABgFJuMGbZgwQJL/Ktf/Uob09bWZon79++f0DnFw969e7W+ZcuWaX0LFy40MZ2w3rZRU7wUFBRofU1NTRFfZ99kzGnRXlVVVfcn1ov0ttw9/vjjLXFjY2NUr7Ofaut0mnY0+vXrZ4nPPfdcbcz//u//an32xavvvPOONqa4uNgSd3V1dWeKrsEmYwAAIOVQfAAAAKMoPgAAgFEUHwAAwCh2OE1BWVlZlvi5557Txjgt8LzhhhsscUdHR3wnhl7DabfJv/71r5b49NNP18bYF5wOHz48vhND2vrss88s8Y4dO7QxJ510ktb385//3BL/7ne/08bs27cv4v0PHjxoiaurq7UxToul7Yuqx4wZo42x7wg9f/78iPNJdzz5AAAARlF8AAAAoyg+AACAUa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+AAAAEZlKPtRfknW0tIiPp8v2dMw5pe//KXW96tf/Sph93vooYcssdMufukkFApJTk6OkXulYu46nRa7fv16re+II2Jfe25fvCwi8rvf/c4S33333doYp1M/GxoaLPHevXu1MZMmTbLEu3fvjmqebtXbc7e7xowZo/XZF4Hm5eVpY9555x1LvGDBAm3MCy+80MPZfTt7fv/pT3/Sxmzbts0Sn3vuuQmbT09Ek7s8+QAAAEZRfAAAAKMoPgAAgFFsMtbL2E8Pfemll7Qxr732mqnpIM769+9viR977DFtjNP6jjvuuMMS//GPf9TGHHfccZb4kksu0cbMmjXLEp900knamKuuukrrs38mf95552ljioqKLHG6r/lAdOwb4s2YMUMbY1/j4bRZ1wUXXGCJo9kYLFr2OZ544onamKqqKkvstAbnmWeeiducko0nHwAAwCiKDwAAYBTFBwAAMIriAwAAGMWCU5dy2ijKvnnTySefrI3Jzc21xOvWrdPG+P1+S1xfX9+NGSIZTjjhBEs8atQobczrr7+u9f3617+2xE57D9pPrHXKHfupn08//bQ2xunUzy+++ELrsxs7dqwl3rRpU8TXIP0NGDDAEn/ve9+L+Bqn3LEvSu3ugtNjjz1W65s9e7YlvuWWWyJex+nk3d///vfdmlMq4skHAAAwiuIDAAAYFVPxUVlZKePGjZPs7GwZNmyYTJs2TRobGy1j2trapLy8XAYPHiwDBgyQsrKyuH5fGugOchduRe4iHcV0sNy5554rl19+uYwbN06++uorue2226ShoUF27NghRx55pIiIzJkzR9atWycrV64Un88nc+fOlczMTPnb3/4W1T3S6YCjaHT3YDn7AV4iIm+99ZYlfuKJJ7o1J/vn9mVlZdqYrq6ubl3btMMHHPWW3LWvi3DaTOnll1/W+s4///yEzGf69Olan30zJRGRrKysiNeyv+6KK67o/sRcoLflbrwUFxdrffbNFIcOHaqNaW9vt8R79uzRxkSzzmjixIla37/9279ZYqe/drdu3WqJzzjjDG3MwYMHI94/FURzsFxMC07tf2itXLlShg0bJvX19XL66adLKBSSJ554QlatWiVnnnmmiIisWLFCTjzxRNm8ebNMmDAh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2tTeLM0k8oFBIRkUGDBomISH19vRw6dMjy3o8ePVqKiop476NA7ppD7sYXuWsOufu1lCs+9u3bJ52dnZKXl2fpz8vLk0AgkKRZpZ+uri6ZN2+eTJo0SU4++WQREQkEAuLxeCQ3N9cylvc+OuSuGeRu/JG7ZpC7/5Jyp9rCjPLycmloaJBNmzYleypATMhduBW5+y8p9+RjyJAh0qdPH22lbzAYlPz8/CTNKr3MnTtX1q5dK6+//nr4GG0Rkfz8fOno6JDm5mbLeN776JC7iUfuJga5m3jkrlXKFR8ej0eKi4ulpqYm3NfV1SU1NTXi9/uTODP3U0rJ3Llzpbq6WtavXy8jRoyw/Ly4uFiysrIs731jY6Ps3r2b9z4K5G7ikLuJRe4mDrn7LZK84NVRVVWV8nq9auXKlWrHjh1q1qxZKjc3VwUCgWRPzdXmzJmjfD6feuONN9TevXvD7csvvwyPmT17tioqKlLr169XdXV1yu/3K7/fn8RZuwu5mxjkbuKRu4lB7jpLyeJDKaWWLFmiioqKlMfjUSUlJWrz5s3JnpLriYhjW7FiRXjMwYMH1bXXXqsGDhyo+vfvr6ZPn6727t2bvEm7ELkbf+SuGeRu/JG7zjKUUsr00xYAANB7pdyaDwAAkN4oPgAAgFEUHwAAwCiKDwAAYBTFBwAAMIriAwAAGEXxAQAAjKL4AAAARlF8AAAAoyg+AACAURQfAADAKIoPAABg1P8HH5KvrZ1Z6vUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import mindspore.dataset.vision as vision\n",
    "\n",
    "# 定义图像增强操作\n",
    "trans = [\n",
    "    # 自动裁剪，参数为图像的输出尺寸大小，填充图像的左侧、上侧、右侧和下侧的像素值\n",
    "    vision.RandomCrop((32, 32), (4, 4, 4, 4)),\n",
    "    # 对图像进行随机水平翻转,参数为图像被翻转的概率\n",
    "    vision.RandomHorizontalFlip(prob=0.7),\n",
    "    # (h, w, c)转换为(c, h, w)\n",
    "    vision.HWC2CHW()\n",
    "]\n",
    "\n",
    "# 在数据处理参数中添加transform\n",
    "dataset = Mnist(path=dataset_dir, batch_size=6, repeat_num=1, shuffle=True, resize=32, transform=trans)\n",
    "dataset = dataset.run()\n",
    "data = next(dataset.create_dict_iterator())\n",
    "\n",
    "images = data['image'].asnumpy()\n",
    "plt.figure()\n",
    "for i in range(1, 7):\n",
    "    plt.subplot(2, 3, i)\n",
    "    plt.imshow(images[i-1][0], interpolation=\"None\", cmap=\"gray\")\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "mindspore",
   "language": "python",
   "name": "mindvision"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
